package com.layui.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.layui.entity.Address;
import com.layui.repository.AddressRepository;
import com.layui.service.AddressService;

/**
 *
 * @author LiShuai
 * @date 2019年2月24日
 */
@Service
public class AddressServiceImpl implements AddressService {

	@Autowired
	private AddressRepository addressRepository;

	/**
	 * @Title: findProvinceByPid
	 * @Description:
	 * @param pid
	 * @return
	 * @see com.layui.service.AddressService#findProvinceByPid(java.lang.Long)
	 */
	@Override
	public List<Address> findProvinceByPid(Long pid) {
		return addressRepository.findProvinceByPid(pid);
	}

	/**
	 * @Title: findCityByPid
	 * @Description:
	 * @param pid
	 * @return
	 * @see com.layui.service.AddressService#findCityByPid(java.lang.Long)
	 */
	@Override
	public List<Address> findCityByPid(Long pid) {
		return addressRepository.findCityByPid(pid);
	}

	/**
	 * @Title: findCountyByPid
	 * @Description:
	 * @param pid
	 * @return
	 * @see com.layui.service.AddressService#findCountyByPid(java.lang.Long)
	 */
	@Override
	public List<Address> findCountyByPid(Long pid) {
		return addressRepository.findCountyByPid(pid);
	}

	/**
	 * @Title: findAddressByPid
	 * @Description: 省市县三级查询整合
	 * @param parseLong
	 * @return
	 * @see com.layui.service.AddressService#findAddressByPid(long)
	 */
	@Override
	public List<Address> findAddressByPid(Long pid) {
		return this.addressRepository.findAddressByPid(pid);
	}

}
